package com.example.haojiutao.controller.user;

import com.example.haojiutao.common.Result;
import com.example.haojiutao.model.domain.Messagelist;
import com.example.haojiutao.service.MessagelistServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * @Description:
 * @Author: wang_meiying
 * @CreateTime: 2024/1/23 19:25
 */
@RestController("UserMessagelistController")
public class MessagelistController {
    @Autowired
    private MessagelistServer messagelistServer;
    @CrossOrigin(origins={"http://localhost:5173"}, allowCredentials = "true")
    @GetMapping("/user/messagelist")
    public Result getRecommendMessageList(){
        Messagelist messagelist=new Messagelist();
        messagelist.setPageSize(5); //显示6条；
        return Result.success("查询成功！",
                messagelistServer.getRecommendMessagelist(messagelist));
    }
}
